package com.qwt.part_time_api.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.qwt.part_time_api.pojo.Species;
import com.qwt.part_time_api.service.SpeciesService;
import com.qwt.part_time_api.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 君子慎独
 * @create 2021/12/25 0025 21:48
 */

@RestController
@RequestMapping("/species")
@Api(tags = {"种类"})
public class SpeciesController {

    @Autowired
    private SpeciesService speciesService;

    /**
     * 查询全部种类
     *
     * @return 种类
     */
    @GetMapping("/allSpecies")
    @ApiOperation(value = "种类列表", notes = "查询全部种类")
    @ApiOperationSupport(author = "Tzeao")
    @ApiResponses(@ApiResponse(code = 200, message = "成功", response = Species.class))
    public Result allSpecies() {
        return speciesService.findAllSpecies();
    }
}
